const express = require("express");

const router = express.Router();

const user_handler = require("../router_handler/user");

// 验证数据的中间件
const expressJoi = require("@escook/express-joi");

// 导入需要的验证规则
const { login_schema } = require("../schema/user.js");

// 注册新用户
router.post("/reguser", expressJoi(login_schema), user_handler.reguser);

// 登录
router.post("/login", expressJoi(login_schema), user_handler.login);

// 导出路由
module.exports = router;
